<template>
	<view class="content">
		
		<u-empty mode="data" icon="../../../static/images/not-data.png" text="暂无数据" v-if="!list">
		</u-empty>
		<view v-else class="list-group">
			<view v-for="(item,index) in list" :key="item.id" class="list-item" @click="handleClick(item)">
				<view style="display: flex;justify-content: space-between;font-size: 28rpx;margin-bottom: 20rpx;">
					<view style="display: flex;align-items: center;">
						<view style="margin-right: 20rpx;color: #2979ff;" class="list-item-index">{{index+1}}</view>
						<view>{{item.khName}}</view>
					</view>
					<view style="color: #999;font-size: 24rpx;">{{item.reportingMonth}}</view>
				</view>
				<u-line></u-line>
				<view style="font-size: 28rpx;">
					<u-row justify="space-between" customStyle="margin-top: 10px">
						<u-col span="6">
							<view style="display: flex;align-items: center;">
								<view style="color: #999999;">姓名：</view> <view>{{item.empname}}</view>
							</view>
						</u-col>
						<u-col span="6">
							<view style="display: flex;align-items: center;">
								<view style="color: #999999;">部门：</view> 
								<view>{{item.orgName}}</view>
							</view>
						</u-col>
					</u-row>
					<u-row justify="space-between" customStyle="margin-top: 10px">
						<u-col span="12">
							<view style="display: flex;align-items: center;">
								<view style="color: #999999;">退回时间：</view> <view>{{item.createtime}}</view>
							</view>
						</u-col>
					
					</u-row>
					<u-row justify="space-between" customStyle="margin-top: 10px">
						<u-col span="12">
							<view style="display: flex;align-items: center;">
								<view style="color: #999999;">流程状态：</view>
								<view v-if="item.processStatus== -1" class="status" style="color: #8B0000;">停用</view>
								<view v-if="item.processStatus== -2 " class="status" style="color: #DC143C;">部门退回</view>
								<view v-if="item.processStatus== -3 " class="status" style="color: #DC143C;">分管领导退回</view>
								<view v-if="item.processStatus== 1" class="status"  style="color: #008000;">启用</view>
								<view v-if="item.processStatus== 2" class="status"  style="color: #0000CD;">部门领导审核</view>
								<view v-if="item.processStatus== 3" class="status"  style="color: #0000CD;">分管领导考核</view>
								<view v-if="item.processStatus== 100" class="status"  style="color: #000000;">处理完毕</view>
							</view>
						</u-col>
					
					</u-row>
					<u-row justify="space-between" customStyle="margin-top: 10px">
						<u-col span="12">
							<view style="display: flex;align-items: center;">
								<view style="color: #999999;">退回原因：</view> <view>{{item.returnReason}}</view>
							</view>
						</u-col>
					
					</u-row>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import dayjs from 'dayjs'
	import {
		GetReviewAssessment
	} from '@/api/main.js'
	export default {
		data() {
			return {
				list: [],
				value1: ""
			}
		},
		onShow() {
			// console.log(dayjs().format('YYYY-MM-DD HH:mm:ss'))
			this.getData()
		},
		methods: {
			getData() {
				let formData = new FormData();
				formData.append('empId', uni.getStorageSync('empid'));
				formData.append('pageNum', 1);
				formData.append('pageSize', 10);
				formData.append('taskStatus', "back");
				GetReviewAssessment(formData).then(response => {
					console.log(response)
					this.list = response.data
					uni.stopPullDownRefresh();
				})
			},
			handleClick(item){
				uni.navigateTo({
					url:`/pages/index/agency-details?id=${item.assessmentempId}`
				})
			}
		},
		// 下拉刷新时触发的函数
		onPullDownRefresh() {
			console.log("下拉刷新时触发的函数")
			this.getData()

		},
		// 上拉触底时触发的函数
		onReachBottom() {
			console.log("上拉触底时触发的函数")
		},
	}
</script>

<style scoped lang="scss">
	.list-group {
		padding: 20rpx;

		.list-item {
			padding: 30rpx;
			background: #ecf5ff;
			margin-bottom: 30rpx;
			border-radius: 10rpx;

			.list-item-index {
				display: flex;
				border: 1px solid #5F9EA0;
				width: 40rpx;
				height: 40rpx;
				align-items: center;
				justify-content: center;
				border-radius: 44rpx;
				font-size: 24rpx;

			}

			.status {
				color: #008B8B;
				font-weight: 400;
			}

			.actions {
				background: #2db7f5;
				color: #ffffff;
				padding: 4rpx 18rpx;
				border-radius: 5rpx;
				font-size: 26rpx;
			}
		}
	}
</style>